home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / I386 / IIS5_01.CAB / IIS_iichkpath.asp < prev    next >
Encoding:
Text File  |  1999-06-03  |  1.1 KB  |  51 lines

  1. <%@ LANGUAGE = VBScript %>
  2. <% Option Explicit %>
  3. <!-- #include file="directives.inc" -->
  4.  
  5. <!--#include file="iichkpath.str"-->
  6.  
  7. <%
  8. Const DIR = "0"
  9. Const FILE = "1"
  10.  
  11. Dim path, ptype, failed, FileSystem, errmsg, onfail, donext
  12.  
  13. path=Request.QueryString("path")
  14.  
  15. 'Defaults to directory, if not passed in...
  16. ptype=Request.QueryString("ptype")
  17.  
  18. onfail=Request.QueryString("onfail")
  19. donext=Request.QueryString("donext")
  20.  
  21. failed = false
  22.  
  23. Set FileSystem=CreateObject("Scripting.FileSystemObject")
  24.  
  25. if ptype = FILE then
  26.     failed =  not FileSystem.FileExists(path)     
  27.     errmsg = L_THEFILE_TEXT & replace(path,"\","\\") & L_NOTEXIST_TEXT 
  28. else
  29.     failed = not FileSystem.FolderExists(path)
  30.     errmsg = L_THEPATH_TEXT & replace(path,"\","\\") & L_NOTEXIST_TEXT 
  31. end if
  32.  
  33. %>
  34.  
  35. <HTML>
  36. <BODY>
  37. <SCRIPT LANGUAGE="JavaScript">
  38.     <% if failed then %>
  39.             alert("<%= errmsg %>");
  40.             <% if onfail <> "" then %>
  41.                 <%= onfail %>
  42.             <% end if %>
  43.     <% else %>
  44.         <% if donext <> "" then %>
  45.             <%= donext %>
  46.         <% end if %>
  47.     <% end if %>
  48. </SCRIPT>
  49. </BODY>
  50. </HTML>
  51.